package org.jupiter.blog.service.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jupiter.blog.api.domain.JupiterArticle;

import java.util.List;

@Mapper
public interface JupiterArticleMapper {

	int insert(JupiterArticle article);

	JupiterArticle selectByUuid(@Param("uuid") String uuid);

	List<JupiterArticle> selectAll();

	int updateByUuidSelective(JupiterArticle article);

	int deleteByUuid(@Param("uuid") String uuid);

	List<JupiterArticle> selectByPage(
		@Param("title") String title,
		@Param("categoryId") String categoryId,
		@Param("status") Integer status,
		@Param("offset") int offset,
		@Param("limit") int limit
	);

	long countByQuery(
		@Param("title") String title,
		@Param("categoryId") String categoryId,
		@Param("status") Integer status
	);

	List<JupiterArticle> selectPublishedArticles();

	List<JupiterArticle> selectStickArticles();

	List<JupiterArticle> selectRecommendArticles();

	List<JupiterArticle> selectCarouselArticles();
}
